package com.yxym.homework;

public class homework07 {
    public static void main(String[] args) {
        car car = new car(30.0);
        car.getAir().flow();
    }
}
class car{
    private  double temperature;

    public car(double temperature) {
        this.temperature = temperature;
    }

    //Air成员内部类
    class Air{
        public void flow(){
            if(temperature > 40){
                System.out.println("吹冷气...");
            }else if(temperature < 0){
                System.out.println("吹暖气...");
            }else {
                System.out.println("关闭空调...");
            }
        }
    }
    //返回一个Air对象
    public Air  getAir(){
        return new Air();
    }
}